<?php
/**
 * File Name: SysSetting.php
 *
 * Author: zl
 * Qq: 178417451
 * createTime 16/6/29 下午4:06
 */

namespace App\Http\Controllers\Admin;


use App\Models\Setting;

class SettingController extends BaseController
{
    public function __construct(Setting $setting)
    {
        parent::__construct();
        $this->setting = $setting;
    }

    public function getEdit()
    {
        //'type' => 'system', 'type' => 'member']
        $data = $this->setting->getList(['type' => ['system', 'member']]);
        return view('admin.setting.index', compact('data'));
    }

    public function postEdit()
    {
        $request = request()->except('_token');
        $res = $this->setting->addsetting($request);
        if($res)
        {
            return redirect()->back();
        }
    }
}